/**
 * 
 */
package com.obradovicnjegovan.webprodavnica.pages;

import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.tynamo.security.services.SecurityService;

import com.obradovicnjegovan.webprodavnica.controller.ControllerAL;
import com.obradovicnjegovan.webprodavnica.entities.Korisnik;

/**
 * @author njegovan
 *
 */
public class KorisnikInfo {
	@Property
	private Korisnik korisnik;
	@Inject
	private SecurityService securityService;
	@Inject
	private ControllerAL controllerAL;
	
	public void onActivate(){
		try {
			korisnik = controllerAL.pronadjiKoriznika(securityService.getSubject().getPrincipal());
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
}